<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>询价管理管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/enquiryGoods/">询价管理列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="enquiryGoods" action="${ctx}/sys/enquiryGoods/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
		    	<li><label>询价日期：</label>
				<input name="startTime" type="text" readonly="readonly" placeholder="开始时间" class="input-medium Wdate " 
					value="<fmt:formatDate value="${startTime }" pattern="yyyy-MM-dd HH:mm:ss"/>"
			         onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			     &nbsp;&nbsp;&nbsp;&nbsp;
			     <input name="endTime" type="text" readonly="readonly" placeholder="结束时间" class="input-medium Wdate " 
					value="<fmt:formatDate  value="${endTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
			     onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/> 
			</li>
			
		    <li><label>用户：</label>
				<form:input path="userName" htmlEscape="false" maxlength="50" class="input-medium"/>
			</li>
			
			 <li><label>下单门店类型：</label>
		        <form:select id="status" path="status" class="input-medium" >
				<form:option value="" label="请选择询价状态"/>
			    <form:options items="${fns:getDictList('reply_status')}" htmlEscape="false" itemValue="value" itemLabel="label"/>
			    </form:select>
			</li>
			
		    <li><label>询价单号：</label>
				<form:input path="code" htmlEscape="false" maxlength="50" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>序号</th>
				<th>询价单号</th>
				<th>用户</th>
				<th>询价时间</th>
				<th>是否需要发票</th>
				<th>品质需求</th>
				<th>联系人</th>
				<th>联系电话</th>
				<th>QQ</th>
				<th>状态</th>
				<shiro:hasPermission name="sys:enquiryGoods:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="enquiryGoods" varStatus="status">
			<tr>
				<td>${status.index+1}</td>
				<td>${enquiryGoods.code }</td>
				<td>
				<c:if test="${enquiryGoods.userType=='1' }">
				      ${enquiryGoods.userName }
				 </c:if>
				  <c:if test="${enquiryGoods.userType=='2' }">
				      ${enquiryGoods.company }
				 </c:if>  
				 </td>
				<td><fmt:formatDate value="${enquiryGoods.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td>${fns:getDictLabel(enquiryGoods.whetherTicket, 'whether_ticket', '')}</td>
				<td >
				 <c:forEach var="quit" items="${enquiryGoods.quitList }">
				${fns:getDictLabel(quit, 'quality_type', '')}
				</c:forEach>
				</td>
				<td>${enquiryGoods.contacts }</td>
				<td>${enquiryGoods.phone }</td>
				<td>${enquiryGoods.oicq }</td>
				<td>${fns:getDictLabel(enquiryGoods.status, 'reply_status', '')}</td>
				<shiro:hasPermission name="sys:enquiryGoods:edit"><td>
    			<a href="${ctx }/sys/enquiryGoods/enquireyDetail?code=${enquiryGoods.code}">查看</a>  
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>